import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-02-18
 * Time: 9:20
 */
class Person{
    public String name;
    public int age;
    public Person(String name,int age){
        this.name=name;
        this.age=age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age && Objects.equals(name, person.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }
}
class Student{

}

public class ObjectClass {
    public static void main(String[] args) {
        Person per1=new Person("1",15);
        Person per2=new Person("1",15);

        System.out.println(per1.equals(per2));

        System.out.println(per1.hashCode());
        System.out.println(per2.hashCode());
    }
}
